<template>
    <div class="g-parent">
        <h2>父组件</h2>
        <!-- 2. 父组件使用子组件的地方，绑定自定义事件 -->
        <Son @change="bindChange"/>
        <p>{{message}}</p>
    </div>
</template>

<script setup>
import Son from './Son.vue';
import { ref } from 'vue';
const message = ref('')
const bindChange = (msg)=>{
    console.log('这是父组件bindChange ',msg);
    message.value = msg
}

</script>

<style lang="css" scoped>
.g-parent{
    width: 600px;
    height: 600px;
    background-color: green
}
</style>